<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
        tr>td{
            text-align: center;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">玩家管理</li>
        </ul>
    </div>
    <form class="layui-form serch" action="{:url('admin/user/index')}" method="post">
        <div class="layui-form-item" style="float: left;">
            {if condition="$res eq 1"}
            <div class="layui-input-inline">
                <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入会员名" class="layui-input layui-btn-sm">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="userid" lay-verify="title" autocomplete="off" placeholder="请输入会员ID" class="layui-input layui-btn-sm">
             </div>
            {else/}
            <div class="layui-input-inline">
                <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入会员ID" class="layui-input layui-btn-sm">
            </div>
            {/if}
            <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">检索</button>
        </div>
    </form>
    <table class="layui-table" lay-size="sm">
        <colgroup>
            <col width="50">
            <col width="100">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
         
            <col width="200">

        </colgroup>
        <thead>
        <tr>
            <th style="text-align: center">玩家ID</th>
            <th style="text-align: center">玩家昵称</th>
            <th style="text-align: center">旗力币</th>
            <th style="text-align: center">房卡数量</th>
             <th style="text-align: center">邀请码</th>
            <th style="text-align: center">实名认证</th>
            <th style="text-align: center">服务状态</th>
            <th style="text-align: center">加入时间</th>
          
            <th style="text-align: center">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="user" id="vo"}
        <tr>
            <td>{$vo.UserID}</td>
            <td>{$vo.NickName}</td>
            <td>{$vo.Score}</td>
             <td>{$vo.InsureScore}</td>
              <td>{$vo.invitation_code}</td>
             <td>{$vo.Compellation}<br/>{$vo.PassPortID}</td>
                <td>  {switch name="$vo.Nullity"}
                 {case value="0" }启用{/case}
                 {case value="1" }禁用{/case}
                 {default /}失败
                 {/switch}</td>
          
             <td>{$vo.RegisterDate}</td>
     
            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('user/qilibi',['id'=>$vo.UserID])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$vo.UserID}" style="margin-right: 0;font-size:12px;">充值旗力币</a>
                    <a href="{:url('user/fknum',['id'=>$vo.UserID])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary " style="margin-right: 0;font-size:12px;">充值房卡</a>
                    <a  href="{:url('user/qynum',['id'=>$vo.UserID])}"class="layui-btn layui-btn-xs a_menu layui-btn-primary " style="margin-right: 0;font-size:12px;">修改邀请码</a>
                    {switch name="$vo.Nullity"}
                     {case value="0" }  <a class="layui-btn layui-btn-xs layui-btn-primary dele" id="{$vo.UserID}" style="margin-right: 0;font-size:12px;">禁用</a>{/case}
                     {case value="1" } <a class="layui-btn layui-btn-xs layui-btn-primary dele" id="{$vo.UserID}" style="margin-right: 0;font-size:12px;">启用</a>{/case}
                     {default /} 
                     {/switch}
                    <a class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.UserID}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>

                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
   
  <div style="padding:0 20px;">{$data->render()}</div>
  
    {include file="public/foot"}
    <script type="text/javascript">

        $('.delete').click(function(){
            var id = $(this).attr('id');
            layer.confirm('确定要删除?', function(index) {
                $.ajax({
                    url:"{:url('admin/user/delete')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                location.href = res.url;
                            },1500)
                        }
                    }
                })
            })
        })


         $('.dele').click(function(){
            var id = $(this).attr('id');
            layer.confirm('确定要更改?', function(index) {
                $.ajax({
                    url:"{:url('admin/user/update')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                location.href = res.url;
                            },1500)
                        }
                    }
                })
            })
        })
    </script>
</div>
</body>
</html>
